//
//  YFSectionHeadView.m
//  SquashSpark
//
//  Created by Coollang on 2017/11/30.
//  Copyright © 2017年 Coollang-YF. All rights reserved.
//

#import "YFSectionHeadView.h"

@implementation YFSectionHeadView

- (void)sectionHeadViewWithTitle:(NSString *)title buttonTitle:(NSString *)btnTitle showRightBtn:(BOOL)show{
    self.titleLabel.text = title;
    [self.rightBtn setTitle:btnTitle forState:UIControlStateNormal];
    self.rightBtn.hidden = !show;
}
+ (instancetype)sectionHeadView {
   return [[NSBundle mainBundle] loadNibNamed:NSStringFromClass([YFSectionHeadView class]) owner:nil options:nil].firstObject;
}

- (IBAction)rightButtonClick:(id)sender {
    if (self.rightButtonAction) {
        self.rightButtonAction(sender);
    }
}

@end
